
import java.util.ArrayList;

import modele.Equation;
import modele.FonctionAOptimiser;
import modele.PointIntersection;
import modele.SolveurSimplexe;


public class Test {
	public static void main(String[] args) {
		
		
		SolveurSimplexe s = new SolveurSimplexe() ;
		s.ajouterEquation(new Equation(1, 0, Equation.INF_EQ, 4)) ;
		s.ajouterEquation(new Equation(1, 0, Equation.SUP_EQ, 0)) ;
		s.ajouterEquation(new Equation(0, 1, Equation.INF_EQ, 3)) ;
		s.ajouterEquation(new Equation(0, 1, Equation.SUP_EQ, 0)) ;
		s.ajouterEquation(new Equation(2, 1, Equation.INF_EQ, 9)) ;
		
		try {
			s.calculPointsRealisables() ;
		} catch (Exception e) {
			System.err.println("erreur : getPointRealisable() :"+e.getMessage());
		}
		
		
		ArrayList<PointIntersection> res;
		try {
			res = s.getPointsDeLespaceConvexe();
			for (PointIntersection intersection : res) {
				System.out.println("--->"+intersection);
			}
		} catch (Exception e) {
			System.err.println("erreur : getPointsDeLespaceConvexe() :"+e.getMessage());
		}
		
		System.out.println("---chemin");
		
		s.setFonctionAOptimmiser(4, 5, FonctionAOptimiser.MAXIMISER) ;
		
		ArrayList<PointIntersection> res2;
		try {
			res2 = s.getCheminVersResultat();
			for (PointIntersection intersection : res2) {
				System.out.println("--->"+intersection);
			}
		} catch (Exception e) {
			System.err.println("erreur : getPointsDeLespaceConvexe() :"+e.getMessage());
		}
		
		
		
		
		
		System.out.println("fin");
	}
}
